package pm.gui.components.basepanels;

import pm.gui.components.DocumentNavigationPanel;
import pm.oo.NativeOOViewComponent;

import javax.swing.*;
import java.awt.*;

/**
 * JPanel with embedded Open Office Frame
 *
 * @author Anton Bernatski
 * @version $Revision$ $Date$
 */
public class DocumentViewPanel extends JPanel {

	public JButton printButton;
	public JButton nextButton;
	public JButton previousButton;
	public JButton backButton;

	private NativeOOViewComponent nativeOOViewComponent;
	private DocumentNavigationPanel navigationPanel;

	public DocumentViewPanel() {
		nativeOOViewComponent = new NativeOOViewComponent();
		navigationPanel = new DocumentNavigationPanel();
		this.printButton = this.navigationPanel.printButton;
		this.nextButton = this.navigationPanel.nextPageButton;
		this.previousButton = this.navigationPanel.previousPageButton;
		this.backButton = this.navigationPanel.backButton;

		this.setLayout(new GridBagLayout());
		this.add(nativeOOViewComponent, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0));
		this.add(navigationPanel, new GridBagConstraints(1, 0, 1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0));
	}

	public NativeOOViewComponent getNativeOOViewComponent() {
		return nativeOOViewComponent;
	}

}
